package homework;

class Second implements Runnable {
	
	@Override
	public void run() {
		for (int i = 1; i <= 50; i++) {
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("NEW");
		}
	}
}

public class Test2 {
	public static void main(String[] args) {
		Thread mainLine = Thread.currentThread();
		Thread t2 = new Thread(new Second());
		t2.start();
		for (int i = 1; i <= 100; i++) {
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("main");
		}
	}
}
